<?php
namespace app\home\controller;

use think\Controller;
use think\Db;
use app\Home\model;
use think\Request;
use think\Session;

class Courses extends Controller{

    //课程
    public function index(){


        $userSession = Session::get("USERS");
        $this->view->assign("user_id",$userSession['user_id']);
        //课程分类
        $courseclassify = Db::table("courseclassify")->select();
        //课程
        $courses = Db::table('courses')->where("courses_del",0)->select();

        $sessionUser = Session::get("USERS");

        $this->assign("sessionUser",$sessionUser);
        $this->assign("courses",$courses);
        $this->assign("courseclassify",$courseclassify);

        return $this->fetch();

    }


}